home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / mac / demoware / Asymptote 1.1 Demo / Scripts / Demos / 12) A465 chart / Demo12 < prev   
Encoding:
Text File  |  1994-11-01  |  1.7 KB  |  70 lines  |  [TEXT/DWat]

  1. % Asymptote demo #12
  2.  
  3. % Plot point symbols and labels
  4. % read from a file
  5.  
  6. graphunits cm
  7. graphframe 5 20 5 20
  8. fullscreen yes
  9.  
  10. % Read the data:
  11. datafile A465.dat
  12. readcolumn x 2
  13. readcolumn y 3
  14.  
  15. % Manipulate the data.
  16. % Shift the origin by (-180,-180).
  17. rpn <x 180 - >x
  18. rpn <y 180 - >y
  19.  
  20. graphlimits            % Find the limits of the data
  21.  
  22. graphaspect 1.0    % Specify that we want a graph with a square grid
  23.  
  24. pendash short        % Specify a dash pattern
  25. drawgrid false        % and draw a grid
  26.  
  27. drawframe            % Draw the frame around the graph
  28.  
  29. % Set the point symbols using values in the data file.
  30. % Read the data in column 4, take the log of these values
  31. % and use them to scale the size of each point:
  32. readcolumn p 4
  33. rpn <p log min - max / >p
  34.  
  35. % The p vector (which Asymptote uses for the point symbols)
  36. % now contains value between 0 and 1.  The fractional part
  37. % of the p vector is the symbol size
  38. % Next, read the data in column 5 and use it for the
  39. % point symbols (filled circle, etc).
  40. % You could also calculate the symbols (see the Asymptote 
  41. % User's guide for examples of this.)
  42. readcolumn e 5
  43. rpn <e <p + >p
  44.  
  45. pointsize 16        % Chose a size for the points and plot them
  46. plotpoints 
  47.  
  48. % Plot a label (read from column 1) next to each point.
  49. readcolumn l 1        % Read column 1 in to the L vector
  50. rpn <x 10 + >x        % Shift the labels a bit
  51. rpn <y .3 + >y
  52. scale .3            % Make the labels very small
  53. textmode reversed
  54. plotlabels aboveleft
  55. textmode
  56. scale .75
  57. drawxlabel Right Ascension Offset (arc seconds)
  58. drawylabel Declination Offset (arc seconds)
  59.  
  60. % Draw the title a bit larger
  61. scale 1.25
  62. drawtitle A465
  63.  
  64. graphframe gleft gright gbottom gtop 1 +
  65. scale 1
  66. drawtitle Point symbols and labels read from the data file
  67.  
  68. % All done reading data so close the data window.
  69. closewindow \f
  70.